package com.nlp.trie.bigramSeg;

/**
 * 有向边，边的权重不能是负数
 * @author ygsong.abcft
 *
 */
public class CnToken {

	public String termText;
	public int start;
	public int end;
	public double logProb;//词本身的概率
	public double nodeProb;//累积概率
	public CnToken bestPrev;//最佳前驱词
	
	public CnToken(int vertextForm, int vertextTo, String word) {
		start = vertextForm;
		end = vertextTo;
		termText = word;
	}
	
	public CnToken(int vertextForm, int vertextTo, double logP, String word) {
		start = vertextForm;
		end = vertextTo;
		termText =word;
		logProb = logP;
	}
	@Override
	public String toString() {
		return "text:" + termText + " start:" + start + " end:" + end
				+ " cost:" + logProb;
	}
	
}
